<#--
* TreeSelect
-->
<#macro TreeSelect path dataList labelText=path fieldText="0" fieldValue="0" required="" class="" attributes="" 
    fieldID=fieldValue fieldParentID="parentid" parentidValue="-1" level=0  separator="－">
  <@spring.bind path/>
  <#assign id="${spring.status.expression?replace('[','')?replace(']','')}">
   <div class="layui-form-item ${errorStatus}">
    <label class="layui-form-label" for="${id}">
        <#if required?contains("required")><b style="color:red;padding:2px;vertical-align: middle;">*</b></#if>${labelText}
    </label>
    <div class="layui-input-block" style="min-width:220px;">
          <select class="width-100" id="${id}" name="${spring.status.expression}" class="${class}" lay-filter="${id}" 
          lay-verify="${required}" lay-verType="tips" lay-reqText="请选择${labelText}"  ${attributes}>
            <#nested>
            <@Recursive dataList fieldID fieldParentID parentidValue level separator; dataItem,level,separator,dataIndex>
                <option value="${dataItem[fieldValue]?html}"<@spring.checkSelected dataItem[fieldValue]/>><#if level gt 0><#list 1..level as i>${separator}</#list></#if>${dataItem[fieldText]?html}
                </option>
            </@Recursive>
          </select>
        </div>
   </div>
</#macro>

<#--
* TreeSelectQuery
-->
<#macro TreeSelectQuery path dataList labelText=path fieldText="0" fieldValue="0" class="" fieldID=fieldValue fieldParentID="parentid" parentidValue="-1" level=0 separator="－">
  <@spring.bind path/>
  <#assign id="${spring.status.expression?replace('[','')?replace(']','')}">
  <div class="layui-form-item margin-5">
      <label class="layui-form-label" for="${id}">${labelText}</label>
      <div class="layui-input-inline">
          <select class="width-190 ${class}" id="${id}" name="${spring.status.expression}" lay-filter="${id}" ${attributes}>
            <#nested>
            <@Recursive dataList fieldID fieldParentID parentidValue level separator;dataItem,level,separator,dataIndex>
              <option value="${dataItem[fieldValue]?html}"<@spring.checkSelected dataItem[fieldValue]/>><#if level gt 0><#list 1..level as i>${separator}</#list></#if>${dataItem[fieldText]?html}</option>
            </@Recursive>
          </select>
      </div>
  </div>
</#macro>